home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
614
< prev
next >
Wrap
Internet Message Format
|
1996-08-06
|
2KB
Path: dispatch.news.demon.net!demon!polo!john
From: john@polo.demon.co.uk (John Winters)
Newsgroups: comp.std.c
Subject: Re: Prefixing functions with return type..
Date: Wed, 20 Mar 1996 17:26:36 GMT
Organization: Wallingford
Message-ID: <DoKtsD.5M7@polo.demon.co.uk>
References: <4hstf8$jf3@cybernews.cyberus.ca> <1996Mar14.080731.15076@Watt.COM> <1996Mar18.201616.6958@watt.com>
X-NNTP-Posting-Host: polo.demon.co.uk
In article <1996Mar18.201616.6958@watt.com>,
Adrian P Stephens <aps@symbionics.co.uk> wrote:
[snip]
>Our standards also require explicit
>identification of the size returned if it is an integer. This is of
>benefit if you are doing emulation/debugging without a symbolic emulator/
>debugger (and how many do that??), but otherwise doesn't allow you to
>pretend you've got "opaque types" in "C". Also, for some things where
>the type is not selected until compile time (e.g. integer sizes and
>size_t particularly) you cannot select a name which is legal in the
>sense of these standards.
>
>Here's an example from a bit of code I'm working on now:
>
>extern TX_MANAGEMENT_PKT * psTxManagementPktTXP_NewTxBeaconPkt(void);
Aaaargh! All those wishing to avoid working for this company,
please form an orderly queue. Don't push.
>
>Elements required in our standard:
>
> TX_MANAGEMENT_PKT - all upper case because it's a typedef/struct
> p - pointer to ...
> sTxManagementPkt - a structure of this type (but case converted)
> TXP - name of module containing global export
> "NewTxBeaconPkt" - What I orginally called the routine before
> - I read our coding standards.
>
>
>Oh, and finally another example from real code:
>
>/*--------------------------------------------------------------------------
> * Routine: u32GetU32
> *
> * Parameters: Name r/w Usage
> * char ** *w ppcParams
> *
> * Returns: u32 value
> *
> * Description:
> * Read and return a u32 value from the command-line, reading decimal
> * numbers by default, or hex if preceded by "0x".
> *--------------------------------------------------------------------------*/
>extern u32 u32GetU32(char ** ppcParams);
>
>Which, I guess, answers "<<++>>" above.
Which I guess is as damning a condemnation of Hungarian notation as
you're going to get.
John
--
John Winters. Wallingford, Oxon, England.